﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication3.Data;
using WebApplication3.Data.Entities;

namespace WebApplication3.Controllers
{
    public class BaseController : Controller
    {
		private readonly ApplicationDbContext applicationDbContext;

		public BaseController(ApplicationDbContext applicationDbContext)
		{
			this.applicationDbContext = applicationDbContext;
		}

		public AppIdentityUser GetUser(string openid) {
			return applicationDbContext.Users.SingleOrDefault(s=>s.OpenId==openid);

		}
    }
}